package com.vast.system.exception;


import com.vast.common.constant.MessageCode;
import com.vast.common.core.domain.Result;

/**
 * @author zhaohao
 * @date 2018年10月24日
 * @Des: 全局操作异常 手动抛出异常处理
 */
public class BusinessException extends RuntimeException {

	private Integer code = MessageCode.ERROR;  //错误码

	public BusinessException() {
		super();

	}

	public BusinessException(String message) {
		super(message);
	}

	public BusinessException(Integer code, String message) {
		super(message);
		this.code = code;
	}

	public BusinessException(Result resultEnum) {
		super(resultEnum.getMsg());
		this.code = resultEnum.getCode();
	}
	public BusinessException(Result resultEnum, String message) {
		super(message);
		this.code = resultEnum.getCode();
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
}
